<?php
class newsAction extends Action {
	public function index(){

		$o = M('news');
		$news = $o->where('display = 1')->order('posttime DESC')->select();
		$this->assign('news', $news);

		$o = M('news2');
		$news2 = $o->where('display = 1')->order('posttime DESC')->select();
		$this->assign('news2', $news2);

		$this->display ();
	}

	public function v() {
		$id = $_GET['id'];

		$o = M('news');
		$v = $o->find($id);
		$this->assign('v', $v);

		$this->display ();
	}

	public function v2() {
		$id = $_GET['id'];

		$o = M('news2');
		$v = $o->find($id);
		$this->assign('v', $v);

		$this->display ();
	}
}
?>